<!--用户管理-->
<template>
  <div class="page-container">

    <ex_super_table_page v-bind="option" ref="superTablePage">
      <template v-slot:action-right>
        <warehouse-group v-auth="'oms_warehouse_group_edit'" @afterSubmit="afterWarehouseGroupChange"></warehouse-group>
      </template>
    </ex_super_table_page>
  </div>
</template>
<script>

import WarehouseGroup from '@/component/pms/warehouse-group.vue'

export default {
  title: "title_Warehouse_group_manage",
  components: { WarehouseGroup },
  data() {
    return {
      option: {
        table: {
          url: "/fms-api/product/PmsWarehouseGroupRpc/selectAll.json",
          model: [
            { key: 'name', label: '分组名称', align: 'left', minWidth: 100 },
            {
              key: 'warehouses', label: '仓库', align: 'left', minWidth: 400,
              attrs: {
                formatter: (r, c, v, i) => {
                  return v.map(rr => '[' + rr.warehouseCode + '] ' + rr.warehouseName).join(',  ')
                }
              }
            }
          ]
        }
      }
    };
  },
  methods: {
    afterWarehouseGroupChange() {
      this.$refs['superTablePage'].reload()
    }
  }
};

</script>
